<%@ page language="java" import="java.util.*" pageEncoding="utf-8"%>

<form class="datagrid-edit-form" data-toggle="validate" data-data-type="jsonp">
    <div class="bjui-row col-1">
  
         <label class="row-label">硬件信息</label>
        <div class="row-input required">
            <input type="text" name="sto_lock_lotype_lcokInfo"   data-rule="required">
        </div> 
       
        <label class="row-label">锁具型号</label>
        <div class="row-input required">
            <input type="text" name="sto_lock_lotype_locType"   data-rule="required">
        </div>

      
    </div>
    <div class="bjui-pageFooter">
    <ul>
    	<li>
    		<button type="button" class="btn-close btn" data-icon="close">取消</button>
    	</li>
    	<li>
    		<button type="button" class="btn-default btn" data-icon="save" onclick="lotype_post_lock()">保存</button>
    	</li>
    	
    </ul>
    </div>
</form>
<script>



function lotype_post_lock(){
	var loc_info = $('[name="sto_lock_lotype_lcokInfo"]').val();
	var loc_no = $('[name="sto_lock_lotype_locType"]').val();
	var ucode = '';
	if(loc_no == '')
		{
			BJUI.alertmsg('info','编号为空，请填写');
			return;
		}
	else if(loc_info == '')
		{
		BJUI.alertmsg('info','型号为空，请填写');
		return;
		}
	else{
		$.ajax({
			url:'addLockType',
			data:{
				/* info:"[{" +
					"\"lcokNo\":\""+loc_no+"\"}]", */
				locType:loc_no,
				hInfo:loc_info
			},
			success:function(data){
				console.log(data);
			
			
				if(data.check=='00'){
					BJUI.alertmsg('info','添加成功');
					$('#sto_message_id').datagrid('refresh',true);
					BJUI.dialog('closeCurrent');
				}
				else if(data.check=='10001'){
					BJUI.alertmsg('info','数据操作失败');
				}
				else if(data.check=='10002'){
					BJUI.alertmsg('info','数据已存在');
				}
			},
			error:function(data){
				alert('系统错误');
			}
		})
	}

}	

</script>